##------------------------------------------------------------------------------
##
##	yasco-1.0 - Yet Another (Java)Script Obfuscator
##	Copyright (C) 2008-2011 Oliver Schieche <post@oliver-schieche.de>
##
##	Makes use of Yapp
##	Parse::Yapp - Copyright (c) 1998-2001, Francois Desarmenien, all right reserved.
##
##	$Id: Id2Value.pm 8 2011-07-07 08:42:03Z goresplatter1844@gmail.com $
##------------------------------------------------------------------------------
package Yasco::Filter::Id2Value;

use strict;
use vars qw[@ISA];

use Data::Dumper;
use Yasco::Filter::Result;
##------------------------------------------------------------------------------
BEGIN {
	require Yasco::Filter;
	@ISA = qw[Yasco::Filter];
}
##------------------------------------------------------------------------------
sub tokens
	{
		qq{ID}
	}
##------------------------------------------------------------------------------
sub new
	{
	    my $self  = shift;
	    my $options = shift;

	    $self = $self->SUPER::new($options);

	    $self
	}
##------------------------------------------------------------------------------
sub execute
	{
		my $self = shift;
		my ($o,$node) = @_;
		my $name = $node->left;

		throw Yasco::Filter::Result($name)
			unless exists($self->{$name});
		throw Yasco::Filter::Result($self->{$name});
	}
##------------------------------------------------------------------------------
1